<template lang="">
  <div>

  </div>
</template>
<script>
//import { mapGetters,mapActions} from 'vuex'
import { GetQueryString } from "@/utils";
import {mapMutations} from 'vuex';
export default {
  name: "wxlogin",
  data() {
    return {};
  },
  methods: {
    ...mapMutations(['SET_TOKEN','SET_USER_ID']),
  },
  mounted() {
    let token = GetQueryString("token");  //token
    let id = GetQueryString("id")   //用户id
    const url = 'http://www.qimiaola.com/Api/Wx/login'
    
    if (token) {
      this.SET_TOKEN(token)
      this.SET_USER_ID(id)
      let pageName = window.localStorage.getItem("auth_from_page");
      if (pageName) {
        window.location.replace(window.location.pathname);
        this.$router.push({ name: pageName });
      }else 
        this.$router.push({ name: 'index' });
    } else {
      window.location.href = url;
    }
  }
};
</script>
<style lang="less" scoped>
</style>